import { request } from '@/utils';
import { getRestBaseUrl } from '@/config';

// 新增
export const save = channelStore =>
  request({
    url: `${getRestBaseUrl()}/iop/channelStoreService/save`,
    method: 'POST',
    data: { channelStore },
    timeout: 3 * 60 * 1000,
  });

// 修改
export const update = channelStore =>
  request({
    url: `${getRestBaseUrl()}/iop/channelStoreService/update`,
    method: 'POST',
    data: { channelStore },
    timeout: 3 * 60 * 1000,
  });

// 查门店
export const getStore = storeCode =>
  request({
    url: `${getRestBaseUrl()}/iop/storeService/get`,
    method: 'POST',
    data: { storeCode },
    timeout: 3 * 60 * 1000,
  });

// 查三方门店名称
export const getChannelName = channelCode =>
  request({
    url: `${getRestBaseUrl()}/iop/channelStoreService/getChannelName`,
    method: 'POST',
    data: { channelCode },
    timeout: 3 * 60 * 1000,
  });

// 查三方渠道信息
export const getThirdChannelInfo = channelCode =>
  request({
    url: `${getRestBaseUrl()}/iop/channelStoreService/getThirdChannelInfo`,
    method: 'POST',
    data: { channelCode },
    timeout: 3 * 60 * 1000,
  });
